odoo.define('num_to_china.NumberToChina', function(require) {
"use strict";
// Field in which the user can both type normally and scan barcodes
var basicFields = require('web.basic_fields');
var fieldRegistry = require('web.field_registry');
var NumberToChina =  basicFields.FieldFloat.extend({
      init: function () {
        this._super.apply(this, arguments);
        },
    _render: function () {
            console.log(this, '_render_value');
            var self = this
                this._rpc({model: 'res.currency',
                        method: 'rmb_upper',
                        args: [parseFloat(this.value)],
                        kwargs: { context: {}}
                         }).then(function (result) {
                            self.$el.text(result);
                        });

        },
    });
    fieldRegistry.add('num_to_china', NumberToChina);
    return NumberToChina;
});